package com.kongjs.application.convert;

import com.kongjs.application.model.dto.*;
import com.kongjs.application.model.entity.Users;
import com.kongjs.application.model.vo.QueryUserParamVO;
import com.kongjs.application.model.vo.QueryUserVO;
import com.kongjs.application.model.vo.SaveUserVO;
import com.kongjs.application.model.vo.UpdateUserVO;
import org.mapstruct.Mapper;
import org.mapstruct.ReportingPolicy;

import java.util.List;

@Mapper(componentModel = "spring",unmappedTargetPolicy = ReportingPolicy.IGNORE,unmappedSourcePolicy = ReportingPolicy.IGNORE)
public interface UsersConverter {
    SaveUserDTO toDto(SaveUserVO vo);

    Users toEntity(SaveUserDTO dto);

    UpdateUserDTO toDto(UpdateUserVO vo);

    Users toEntity(UpdateUserDTO dto);

    QueryUserParamDTO toDto(QueryUserParamVO paramVO);

    List<QueryUserVO> toVos(List<QueryUserDTO> items);

    QueryUserDTO toDto(Users users);

    UserInfoDTO toInfo(Users users);

    UserCacheDTO toCache(Users users);
}
